{% extends './_common/layout.html' %}

{% block head %}
<title>注册</title>
{% endblock %}

{% block body %}
<h1>登录</h1>
<div>
    <p>
        u_id: <input type="text" id="u_id" name="u_id" />
    </p>
    <p>
        u_pass: <input type="text" id="u_pass" name="u_pass" />
    </p>
    <p>
        u_email: <input type="text" id="u_email" name="u_email" />
    </p>
    <div onclick="regionHandler()">注册</div>
</div>


{% endblock %}
{% block content %}
<script type="text/javascript">
    function regionHandler() {
        const _data = {
            username: $('#u_id').val(),
            password: $('#u_pass').val(),
            email: $('#u_email').val()
        };
        $.ajax({
            url: '/user/region.paper',
            type: 'POST',
            data: _data,
            dataType: 'json',
            success: (res) => {
                console.log(res)
                if(res.success) {
                    // window.location.replace('/');
                }
            }
        });
    }
</script>
{% endblock %}
